import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'


// 引入初始化样式文件
import '@/styles/common.scss'
import 'element-plus/dist/index.css'
// 引入element-plus插件与样式
import ElementPlus from 'element-plus'
// 配置element-plus国际化
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// 引入模版的全局样式
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
// pinia持久化插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

// 安装pini
app.use(pinia)
// 安装路由
app.use(router)

// 注册element-plus
app.use(ElementPlus, {
    locale: zhCn,
})

app.mount('#app')


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
